package Day03_java方法.java13_方法调用;
public class 可变参数 {
    public static void main(String[] args) {
        可变参数 可变参数 = new 可变参数();
        可变参数.printMax(13,2,26,4,5);
    }
    public static void printMax(double... numbers){
        if (numbers.length==0){
            System.out.println("No argument passed");
            return;
        }
        double result = numbers[0];
        //排序
        for (int i = 0; i < numbers.length; i++) {
            if (numbers[i] > result){
                result = numbers[i];
            }
        }
        System.out.println("Themax value is "+ result);
    }
}
